Why does my PHP recursive function only return the first level of children from the database